package com.goldplusgold.tradedelay.app.market.widget;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.goldplusgold.tradedelay.app.R;
import com.goldplusgold.tradedelay.app.market.pojo.TDProductDetailInfo;

//import org.androidannotations.annotations.ViewById;

//import com.haotunet.app.goldtreasure.R;
//import com.haotunet.app.goldtreasure.model.TDProductDetailInfo;
//
//import butterknife.ButterKnife;
//import butterknife.ViewById;

/**
 * Created by Administrator on 2017/3/13.
 */
public class TDProductDetailDialog extends Dialog {
    private LayoutInflater mLayoutInflater;
    private Activity mcontext;
    private View view;
    private TDProductDetailInfo mDetailInfo;
    private TextView tradeCode;
    private TextView tradeUnit;
    private TextView minimumTradeVolume;
    private TextView maximumVolume;
    private TextView lowestMarginLevel;
    private TextView limitMovePercent;
    private TextView marginLevel;
    private TextView fee;
    private TextView delayCompensation;

    public TDProductDetailDialog(Activity context, TDProductDetailInfo detailInfo, int theme) {
        super(context, theme);
        mDetailInfo = detailInfo;
        mcontext = context;
        mLayoutInflater = (LayoutInflater) mcontext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        initViews();
    }

    private void initViews() {
        view = mLayoutInflater.inflate(R.layout.dialog_type_detail, null);
        setContentView(view);
        tradeCode = (TextView) view.findViewById(R.id.trade_code);
        tradeUnit = (TextView) view.findViewById(R.id.trade_unit);
        minimumTradeVolume = (TextView) view.findViewById(R.id.minimum_trade_volume);
        maximumVolume = (TextView) view.findViewById(R.id.maximum_volume);
        marginLevel = (TextView) view.findViewById(R.id.margin_level);
        lowestMarginLevel = (TextView) view.findViewById(R.id.lowest_margin_level);
        limitMovePercent = (TextView) view.findViewById(R.id.limit_move_percent);
        fee = (TextView) view.findViewById(R.id.fee);
        delayCompensation = (TextView) view.findViewById(R.id.delay_compensation);

        setCanceledOnTouchOutside(true);
        tradeCode.setText(mDetailInfo.getTradeCode());
        tradeUnit.setText(mDetailInfo.getTradeUnit());
        minimumTradeVolume.setText(mDetailInfo.getMinimumTradeVolume());
        maximumVolume.setText(mDetailInfo.getMaximumVolume());
        marginLevel.setText(mDetailInfo.getMarginLevel());
        lowestMarginLevel.setText(mDetailInfo.getLowestMarginLevel());
        limitMovePercent.setText(mDetailInfo.getLimitMovePercent());
        fee.setText("" + mDetailInfo.getFee());
        delayCompensation.setText(mDetailInfo.getDelayCompensation());
    }
}
